package cn.lzm.fault.tolerant;

import cn.lizemin.entity.RpcResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * @author lzm
 * @Date 2024/11/8
 * @description 静默处理异常
 */
public class FailSafeTolerantStrategy implements TolerantStrategy{

    private static final Logger log = LoggerFactory.getLogger(FailSafeTolerantStrategy.class);

    /**
     * 静默处理异常 - 容错策略
     *
     * @param context 上下文，用于传递数据
     * @param e 异常
     * @return
     */
    @Override
    public RpcResponse doTolerant(Map<String, Object> context, Exception e) {
        log.info("静默处理异常", e);
        return new RpcResponse();
    }

}
